﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Models;
using DAL;
namespace BLL
{
    public class Usertab_RoleBll
    {
        /// <summary>
        /// 添加用户信息
        /// </summary>
        /// <param name="user">用户类</param>
        /// <returns></returns>
        public int AddUser(Models.Usertab_Role user)
        {
            return new DAL.Usertab_RoleDal().AddUser(user);
        }
        /// <summary>
        /// 用户信息判断
        /// </summary>
        /// <param name="del"></param>
        /// <returns></returns>
        public List<Models.Usertab_Role> userShowpd(Models.Usertab_Role del)
        {
            return new DAL.Usertab_RoleDal().userShowpd(del);
        }
        /// <summary>
        /// 用户信息查找
        /// </summary>
        /// <param name="del"></param>
        /// <returns></returns>
        public List<Models.Usertab_Role> idShow(int userid)
        {
            return new DAL.Usertab_RoleDal().idShow(userid);
        }
        /// <summary>
        /// 用户信息分页
        /// </summary>
        /// <param name="del"></param>
        /// <returns></returns>
        public List<Models.Usertab_Role> userShow(out int zongCount, int pageIndex, int pageSize, string userName)
        {
            return new DAL.Usertab_RoleDal().userShow(out zongCount, pageIndex, pageSize, userName);
        }
        /// <summary>
        /// 修改用户信息
        /// </summary>
        /// <param name="user">用户类</param>
        /// <returns></returns>
        public int delUser(Models.Usertab_Role user)
        {
            return new DAL.Usertab_RoleDal().delUser(user);
        }
        /// <summary>
        /// 冻结、解冻用户
        /// </summary>
        /// <param name="userdel"></param>
        /// <param name="userid"></param>
        /// <returns></returns>
        public int userDong(int userdel, int usershan, int userid)
        {
            return new DAL.Usertab_RoleDal().userDong(userdel, usershan, userid);
        }
        /// <summary>
        /// 角色信息读取
        /// </summary>
        /// <returns></returns>
        public List<Models.Usertab_Role> showRole()
        {
            return new DAL.Usertab_RoleDal().showRole();
        }
        /// <summary>
        /// 角色信息添加
        /// </summary>
        /// <returns></returns>
        public int addRole(string rolename)
        {
            return new DAL.Usertab_RoleDal().addRole(rolename);
        }
        /// <summary>
        /// 角色信息删除
        /// </summary>
        /// <returns></returns>
        public int delRole(int roleid)
        {
            return new DAL.Usertab_RoleDal().delRole(roleid);
        }
        /// <summary>
        /// 角色信息修改
        /// </summary>
        /// <returns></returns>
        public int updRole(int roleid, string rolename)
        {
            return new DAL.Usertab_RoleDal().updRole(roleid, rolename);
        }
    }
}
